require([], function() {

	var R_url='../../app/';


    var grid = null;
    $(function () {
        $("#ligergrid1").ligerGrid({
        	url: '<%=path%>/demo/demo/initList.do',
        	method : 'get',
            columns: [
	            { display: '主键', name: 'CustomerID', align: 'left', width: 120 },
	            { display: '公司名', name: 'CompanyName', minWidth: 60 },
	            { display: '联系名', name: 'ContactName', width: 50,align:'left' },
	            { display: '联系名', name: 'ContactName', minWidth: 140 },
	            { display: '联系名', name: 'ContactName', minWidth: 140 },
	            { display: '联系名', name: 'ContactName', minWidth: 140 },
	            { display: '联系名', name: 'ContactName', minWidth: 140 },
	            { display: '城市', name: 'City' }
            ],
            pageSize:10,
            hideLoadButton : true,
            width: '100%',
            isScroll: false,
            checkbox:true,
            rownumbers:true,
            onRenderComplete: function () {
            	iframeResize ();
            }
        });
        grid = liger.get("ligergrid1");

        $("#searchBar").ligerForm();

        $("#searchBtn").click(function(event) {
             var form = new liger.get("searchBar");
             var data = form.getData();
             alert(JSON.stringify(data));
             for (name in data){
                grid.setParm(name,data[name]);
             };
            grid.reload();
        });

        $("#pageloading").hide();

    });

    function iframeResize () {
        if (parent.mainApp) {
	        parent.mainApp.parentTab.onResize();
        };
    }

});